package com.youlu.campus.wechat.repositories;

import com.youlu.campus.wechat.entity.WechatProfitSharingLog;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * 微信商户分账操作记录 Repository 接口
 */
public interface WechatProfitSharingLogRepository extends MongoRepository<WechatProfitSharingLog, String> {

    /**
     * 根据商户ID查询分账记录
     */
    List<WechatProfitSharingLog> findByMerchantId(String merchantId);

    /**
     * 根据分账账户ID查询分账记录
     */
    List<WechatProfitSharingLog> findByAccountId(String accountId);

    WechatProfitSharingLog findByMerchantIdAndAccountId(String merchantId, String accountId);

    void deleteByMerchantIdAndAccountId(String merchantId, String accountId);

    /**
     * 根据商户ID查询分账记录数量
     */
    long countByMerchantId(String merchantId);
}